package com.ddpt.platform.common.util;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ddpt.platform.common.dto.PageDto;

/**
 * 分页对象构建
 */
public class PageUtils {

    public static <T> Page<T> buildPage(PageDto form) {
        return buildPage(form.getCurrentPage(), form.getShowCount());
    }

    public static <T> Page<T> buildPage(Integer page, Integer size) {
        if (page == null) page = 1;
        if (size == null) size = 10;
        return new Page<>(page, size);
    }
}
